var rTarget;
var rPop_top;
var rPop_left;
var rPopup = window.createPopup();
var rulesetList;

function Reamark_Ruleset(obj, sCase_no) {

	var case_no = sCase_no;

	rTarget = obj;

	rPop_top = document.body.clientTop + RGetObjectTop(obj) - document.body.scrollTop;

	rPop_left = document.body.clientLeft + RGetObjectLeft(obj) -  document.body.scrollLeft;

	Show_ruleset(case_no);
}



function Show_ruleset(case_no) {
	Ruleset_HTML = "<html><body>";
	Ruleset_HTML += "<table width='100%' id='Rulset_Table'><tr><td>";
	
	var remark = rulesetList[case_no];
	if (remark.replace(" ", "") == "") remark = "No Remark"; 
		
	Ruleset_HTML += remark;
	Ruleset_HTML += "</td></tr></table>";
	Ruleset_HTML += "</body></html>";

	var oPopBody = oPopup.document.body;

	oPopBody.style.backgroundColor = "lightyellow";

	oPopBody.style.border = "solid black 1px";

	oPopBody.innerHTML = Ruleset_HTML;


	var rulesetHeight = oPopBody.document.all.Rulset_Table.offsetHeight;

	oPopup.show(rPop_left + 25, (rPop_top + rTarget.offsetHeight), 250, rulesetHeight, document.body);
}



function RGetObjectTop(obj) {

	if (obj.offsetParent == document.body || obj.offsetParent.tagName == "HTML")
		return obj.offsetTop;

	else
		return obj.offsetTop + RGetObjectTop(obj.offsetParent);

}



function RGetObjectLeft(obj) {

	if (obj.offsetParent == document.body || obj.offsetParent.tagName == "HTML")

		return obj.offsetLeft;

	else

		return obj.offsetLeft + RGetObjectLeft(obj.offsetParent);

}
